package com.wfw.consumer.consul.controller;

import com.wfw.consumer.consul.entity.UserInfo;
import com.wfw.consumer.consul.feign.UserInfoFeign;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by yuzhongbo on 2018/9/14.
 */
@EnableAutoConfiguration
@RestController("userInfo")
@Api(tags="用户信息API")
public class UserInfoController {
    @Autowired
    UserInfoFeign userInfoFeign;

    @RequestMapping("/getUserinfos")
    @ApiOperation(value="获取所有用户")
    public List<UserInfo> getUserinfos() {
        return userInfoFeign.getUserinfos();
    }
}
